package com.gift.service.webservice;


import com.gift.pojo.User;
import com.gift.pojo.UserTable;


import javax.jws.WebParam;
import javax.jws.WebService;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;


@WebService
public class HelloWSImpl implements HelloWS {
	Map<Integer, User> users = new LinkedHashMap<Integer, User>();

	public String sayHi(@WebParam(name = "text") String text) {
		return "Hello,"+text;
	}

	public String sayHiToUser(User user) {
		users.put(users.size()+1, user);
		return "Hello,"+user.getName();
	}

	public String[] SayHiToUserList(List<User> userList) {
		String[] result = new String[userList.size()];
		int i = 0;
		for(User u:userList){
			result[i] = "Hello " + u.getName();
			i++;
		}
		return result;
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
